package cn.com.victorysoft.ylgl.service.commons.domain;

import cn.com.victorysoft.ylgl.service.commons.json.DateToISODateTimeSerializer;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/***
    日期范围实体
 */
public class DateRangeEntity {
    @DateTimeFormat(
            pattern = "yyyy-MM-dd"
    )
    private Date StartDate;

    @DateTimeFormat(
            pattern = "yyyy-MM-dd"
    )
    private Date EndDate;

    @JsonSerialize(
            using = DateToISODateTimeSerializer.class
    )
    public void setStartDate(Date rq) {
        this.StartDate = rq;
    }

    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd")
    public Date getStartDate() {
        return StartDate;
    }

    @JsonSerialize(
            using = DateToISODateTimeSerializer.class
    )
    public void setEndDate(Date rq) {
        this.EndDate = rq;
    }

    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd")
    public Date getEndDate() {
        return EndDate;
    }
}
